package cn.iocoder.yudao.module.erp.controller.admin.strategy.uniqueNo;

import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.module.erp.dal.dataobject.saleorder.SaleOrderDO;
import cn.iocoder.yudao.module.erp.dal.mysql.saleorder.SaleOrderMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
/**
 * @author Max-u-19
 */
@Component("UniqueSaleOrderNo")
public class UniqueSaleOrderNo implements UniqueNoStrategy{

    @Resource
    private SaleOrderMapper saleOrderMapper;
    @Override
    public Boolean uniqueNo(String no) {
        SaleOrderDO saleOrderDO = saleOrderMapper.selectByNo(no);
        return ObjUtil.isNotEmpty(saleOrderDO);
    }
}
